Page({
  data: {
    currentTab: 0, //预设当前项的值
    winWidth: 0,// 页面配置 
    winHeight: 0,
    cards: [
      { money: "10", date: "8.17~8.30", checked:true},
      { money: "20", date: "8.27~8.30", checked: false },
      { money: "50", date: "9.17~10.30", checked: false}
    ]
  },
  selectedCard(e) {
    var that= this;
    var idx = e.currentTarget.dataset.idx;
    var cur = "cards[" + idx + "].checked";//先用一个变量，把(info[0].gMoney)用字符串拼接起来
    if (that.data.cards[idx].checked==false) {
      that.setData({
        [cur]: true
      });
    }else{
      that.setData({
        [cur]: false
      });
    }
  },
  onLoad: function (options) {
    var that = this;
    /* 获取系统信息 */
    wx.getSystemInfo({
      success: function (res) {
        that.setData({
          winWidth: res.windowWidth,
          winHeight: res.windowHeight
        });
      }
    });
  },
  /*生命周期函数--监听页面显示*/
  onShow: function () {

  }
})